package com.longjianghuasheng.logistics.business.wallet

import androidx.lifecycle.MutableLiveData
import com.longjianghuasheng.logistics.base.BaseMultiStateViewModel
import com.longjianghuasheng.logistics.data.model.bean.ApiResponseNoData
import com.longjianghuasheng.logistics.ext.commit2
import com.longjianghuasheng.logistics.ext.toastNormal
import com.longjianghuasheng.logistics.network.apiService

class WithdrawViewModel : BaseMultiStateViewModel() {

    var price = ""
    var type = 1
    var type_name = ""

    val result by lazy {
        MutableLiveData<ApiResponseNoData>()
    }

    fun my_withdraw() {

        if (type_name.isBlank()) {
            toastNormal("输入有误")
            return
        }

        commit2({ apiService.my_withdraw(price, type, type_name) }, result)
    }

}